package model

import (
	"time"
)

const TableNameHomePledge = "home_pledge"

// HomePledge mapped from table <home_pledge>
type HomePledgeModel struct {
	ID                  int64     `gorm:"column:id;primaryKey;comment:质押序号" json:"id"`                              // 质押序号
	UserID              int64     `gorm:"column:user_id;not null;comment:会员序号" json:"user_id"`                      // 会员序号
	PledgeAmount        float64   `gorm:"column:pledge_amount;not null;comment:质押金额" json:"pledge_amount"`          // 质押金额
	VipDict             int32     `gorm:"column:vip_dict;not null;comment:会员等级" json:"vip_dict"`                    // 会员等级
	DividendRate        float64   `gorm:"column:dividend_rate;not null;comment:分红系数比例" json:"dividend_rate"`        // 分红系数比例
	TotalDividendAmount float64   `gorm:"column:total_dividend_amount;comment:累计分红金额" json:"total_dividend_amount"` // 累计分红金额
	DayDividendAmount   float64   `gorm:"column:day_dividend_amount;comment:今日分红金额" json:"day_dividend_amount"`     // 今日分红金额
	LossRate            float64   `gorm:"column:loss_rate;comment:亏损比例" json:"loss_rate"`                           // 亏损比例
	PledgeStateDict     int32     `gorm:"column:pledge_state_dict;not null;comment:质押状态" json:"pledge_state_dict"`  // 质押状态
	CreatedAt           time.Time `gorm:"column:created_at;comment:创建时间" json:"created_at"`                         // 创建时间
	UpdatedAt           time.Time `gorm:"column:updated_at;comment:修改时间" json:"updated_at"`                         // 修改时间
	//User                *HomeUserInfoModel `gorm:"foreignKey:id;references:user_id"  json:"account"`
}

// TableName HomePledge's table name
func (t *HomePledgeModel) TableName() string {
	return TableNameHomePledge
}
